package com.ys.base;

import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * Description  公共属性枚举类
 * Created by 王伟
 * Date create on 12:18 2019/12/19.
 */
public interface EnumType {


    enum ROLE {
        普通用户(0), 银卡(1), 金卡(2), 白金(3), 黑卡(4);

        private int role;

        ROLE(int role) {
            this.role = role;
        }

        public int getRole() {
            return role;
        }
    }

    enum GroupIdentity {
        /**
         *
         */
        MASTER(1, "群主"),
        MANAGER(2, "管理员"),
        MEMBERS(3, "成员");

        private int code;
        private String desc;

        GroupIdentity(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    enum ResponseCode {
        /**
         *
         */
        SUCCESS("200", "操作成功"),
        Fail("500", "操作失败"),
        ILLEGAL("400", "非法参数");

        private String code;
        private String desc;

        ResponseCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    enum MessageCode {
        /**
         *
         */
        MESSAGE_SEND_ERROR(-2, "网络错误"),
        MESSAGE_TERMINAL_ERROR(-1, "终端信息传递出错"),
        MESSAGE_LOGIN_TIP(0, "登录"),
        MESSAGE_STRING(1, "文字"),
        MESSAGE_IMAGE(2, "图片"),
        MESSAGE_RED_PACK(3, "红包"),
        MESSAGE_RED_PACK_GRAD(4, "抢红包"),
        MESSAGE_TRANSFER_UNDO(5, "转账撤销"),
        MESSAGE_TRANSFER(6, "转账"),
        MESSAGE_TRANSFER_CONFIRM(7, "转账确认"),
        MESSAGE_TRANSFER_REFUSE(8, "转账拒绝"),
        MESSAGE_CHECK_HEART(9, "心跳检测"),
        MESSAGE_USER_AGREE(10, "好友同意"),
        MESSAGE_USER_APPLY(11, "好友申请"),
        MESSAGE_GROUP_ADD(12, "添加群组"),
        MESSAGE_GROUP_DEL(13, "删除群组"),
        MESSAGE_GROUP_TURN(14, "移交群组"),
        MESSAGE_GROUP_DEL_MEMBER(15, "删除成员"),
        MESSAGE_GROUP_ADD_MEMBER(16, "添加成员"),
        MESSAGE_GROUP_SET_REMARK(17, "群成员修改备注名称"),
        MESSAGE_GROUP_UPDATE_NAME(18, "修改群名称"),
        MESSAGE_GROUP_UPDATE_NOTICE(19, "修改群公告"),
        MESSAGE_GROUP_SET_IS_AUDIT(20, "审核入群"),
        MESSAGE_GROUP_EXIT(21, "退出群聊"),
        MESSAGE_GROUP_AGREE_IN(22, "同意入群"),
        MESSAGE_GROUP_INVITE_USER(23, "邀请用户入群"),
        MESSAGE_GROUP_SET_MANAGER(24, "设置管理员"),
        MESSAGE_GROUP_SET_BANNED(25, "设置禁言"),
        MESSAGE_GROUP_IS_BANNED(26, "被禁言"),
        MESSAGE_GROUP_ALL_BANNED(27, "全员禁言"),
        MESSAGE_GROUP_SET_MEMBER_PROTECT(28, "成员保护模式"),
        MESSAGE_GROUP_IS_NON_BANNED(29, "取消禁言"),
        MESSAGE_GROUP_INVITE_USER_NEED_VALIDATE(30, "邀请用户入群需要验证"),
        MESSAGE_GROUP_JOIN_GROUP_NEED_VALIDATE(31, "用户加入群聊需要验证"),
        MESSAGE_GROUP_UNDO_MESSAGE(32, "消息撤销"),
        MESSAGE_SCREEN_HOST_NOTICE(33, "截屏通知"),
        MESSAGE_LAUNCH_SCREEN_HOST_NOTICE(34, "发起截屏"),
        MESSAGE_SET_ADVERT_INTERCEPT(35, "广告拦截"),
        MESSAGE_GROUP_SET_BAN_GRAD(36, "设置禁止抢红包"),
        //        MESSAGE_GROUP_IS_BAN_GRAD(37, "被设置禁止抢红包"),
//        MESSAGE_GROUP_IS_NON_BAN_GRAD(38,"取消禁止抢红包"),
        MESSAGE_GROUP_SET_GRAD_TIME_COUNT(39, "设置用户规定时间内能抢红包次数"),
        MESSAGE_GROUP_SET_GRAD_ALL(40, "禁止全员抢红包"),


        MESSAGE_COMPLAIN_NOTICE(50, "添加投诉"),
        MESSAGE_FRIEND_NO_APPLY_AGREE(51, "用户不需同意直接添加好友"),
        MESSAGE_SEND_USER_CARD(101, "名片"),
        MESSAGE_CLEAR(52, "消息清理"),
        MESSAGE_SOUNDS(100, "语音"),
        SYS_NOTICE(500, "系统通知"),
        SYSTEM_ACCOUNT_DISABLE(501, "账号禁用通知"),
        SYSTEM_ACCOUNT_FREEZE(504, "账号注销通知"),
        SYSTEM_GROUP_ENABLE(502, "群解封通知"),
        SYSTEM_GROUP_DISABLE(503, "群禁止通知"),
        MESSAGE_FUND_BACK(510, "资金退回"),
        MESSAGE_CONFIRM(1000, "消息确认"),
        MESSAGE_UNREAD_CONFIRM(1001, "消息确认"),
        MESSAGE_UNREAD_OVER(1002, "本次未读消息处理完成确认"),

        ;


        private Integer code;
        private String desc;

        MessageCode(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getDescByCode(Integer code) {
            for (MessageCode value : MessageCode.values()) {
                if (value.getCode().equals(code)) {
                    return value.getDesc();
                }
            }
            return MESSAGE_STRING.getDesc();
        }
    }


    enum ComplainCode {
        /**
         * 敏感词
         */
        COMPLAIN_SENSITIVE_WORDS(1, "敏感词"),
        /**
         * 存在涉黄涉赌行为
         */
        COMPLAIN_INVOLVED_IN_HUANG(2, "存在涉黄涉赌行为"),
        /**
         * 此账号可能被盗用了
         */
        COMPLAIN_ACCOUNT_THEFT(3, "此账号可能被盗用了"),
        /**
         * 存在欺诈骗钱行为
         */
        COMPLAIN_FRAUD(4, "存在欺诈骗钱行为"),
        /**
         * 发布不适当内容对我造成骚扰
         */
        COMPLAIN_INAPPROPRIATE_CONTENT(5, "发布不适当内容对我造成骚扰");


        private Integer code;
        private String desc;

        ComplainCode(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(ComplainCode.values())
                    .collect(Collectors.toMap(ComplainCode::getCode, ComplainCode::getDesc))
                    .entrySet()
                    .stream()
                    .map(obj -> {
                        HashMap<String, Object> hashMap = new HashMap(2);
                        hashMap.put("code", obj.getKey());
                        hashMap.put("cause", obj.getValue());
                        return hashMap;
                    })
                    .collect(Collectors.toList());
        }

    }

    enum BannedCode {
        /**
         * 10分钟
         */
        BANNED_CODE_1(1, "10分钟", 10 * 60L),
        /**
         * 30分钟
         */
        BANNED_CODE_2(2, "30分钟", 30 * 60L),
        /**
         * 1小时
         */
        BANNED_CODE_3(3, "1小时", 60 * 60L),
        /**
         * 6小时
         */
        BANNED_CODE_4(4, "6小时", 6 * 60 * 60L),
        /**
         * 12小时
         */
        BANNED_CODE_5(5, "12小时", 12 * 60 * 60L),
        /**
         * 1天
         */
        BANNED_CODE_6(6, "1天", 24 * 60 * 60L),
        /**
         * 7天
         */
        BANNED_CODE_7(7, "7天", 7 * 24 * 60 * 60L),
        /**
         * 1个月
         */
        BANNED_CODE_8(8, "1个月", 30 * 24 * 60 * 60L),
        /**
         * 1年
         */
        BANNED_CODE_9(9, "1年", 12 * 30 * 24 * 60 * 60L);


        private Integer key;
        private Long value;
        private String desc;

        BannedCode(Integer key, String desc, Long value) {
            this.key = key;
            this.desc = desc;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public void setKey(Integer key) {
            this.key = key;
        }

        public Long getValue() {
            return value;
        }

        public void setValue(Long value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(BannedCode.values())
                    .collect(Collectors.toMap(BannedCode::getKey, BannedCode::getDesc))
                    .entrySet()
                    .stream()
                    .map(obj -> {
                        HashMap<String, Object> hashMap = new HashMap(2);
                        hashMap.put("code", obj.getKey());
                        hashMap.put("desc", obj.getValue());
                        return hashMap;
                    })
                    .collect(Collectors.toList());
        }

        public static long getValueByCode(Integer code) {
            for (BannedCode entity : BannedCode.values()) {
                if (code.equals(entity.getKey())) {
                    return entity.getValue();
                }
            }
            return 0L;
        }

        public static String getDescByCode(Integer code) {
            for (BannedCode entity : BannedCode.values()) {
                if (code.equals(entity.getKey())) {
                    return entity.getDesc();
                }
            }
            return "";
        }
    }


    enum MessageClearCode {

        MESSAGE_CLEAR_CODE_0(0, "关闭", 0L),
        /**
         * 1分钟
         */
        MESSAGE_CLEAR_CODE_1(1, "1分钟", 60L),
        /**
         * 5分钟
         */
        MESSAGE_CLEAR_CODE_2(2, "5分钟", 5 * 60L),
        /**
         * 5分钟
         */
        MESSAGE_CLEAR_CODE_3(3, "10分钟", 10 * 60L),
        /**
         * 30分钟
         */
        MESSAGE_CLEAR_CODE_4(4, "30分钟", 30 * 60L),
        /**
         * 1小时
         */
        MESSAGE_CLEAR_CODE_5(5, "1小时", 60 * 60L),
        /**
         * 12小时
         */
        MESSAGE_CLEAR_CODE_6(6, "12小时", 12 * 60 * 60L),
        /**
         * 24小时
         */
        MESSAGE_CLEAR_CODE_7(7, "24小时", 24 * 60 * 60L),
        /**
         * 36小时
         */
        MESSAGE_CLEAR_CODE_8(8, "36小时", 36 * 60 * 60L),
        /**
         * 48小时
         */
        MESSAGE_CLEAR_CODE_9(9, "48小时", 48 * 60 * 60L),

        /**
         * 72小时
         */
        MESSAGE_CLEAR_CODE_10(10, "72小时", 72 * 60 * 60L);


        private Integer key;
        private Long value;
        private String desc;

        MessageClearCode(Integer key, String desc, Long value) {
            this.key = key;
            this.desc = desc;
            this.value = value;
        }

        public Integer getKey() {
            return key;
        }

        public void setKey(Integer key) {
            this.key = key;
        }

        public Long getValue() {
            return value;
        }

        public void setValue(Long value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(MessageClearCode.values())
                    .collect(Collectors.toMap(MessageClearCode::getKey, MessageClearCode::getDesc))
                    .entrySet()
                    .stream()
                    .map(obj -> {
                        HashMap<String, Object> hashMap = new HashMap(2);
                        hashMap.put("code", obj.getKey());
                        hashMap.put("desc", obj.getValue());
                        return hashMap;
                    })
                    .collect(Collectors.toList());
        }

        public static long getValueByCode(Integer code) {
            for (MessageClearCode entity : MessageClearCode.values()) {
                if (code.equals(entity.getKey())) {
                    return entity.getValue();
                }
            }
            return MESSAGE_CLEAR_CODE_0.getValue();
        }

        public static String getDescByCode(Integer code) {
            code = code == null ? 0 : code;
            for (MessageClearCode entity : MessageClearCode.values()) {
                if (code.equals(entity.getKey())) {
                    return entity.getDesc();
                }
            }
            return MESSAGE_CLEAR_CODE_0.getDesc();
        }
    }

    enum DirectionCode {
        INCREASE("INCREASE", "入账"),
        DECREASE("DECREASE", "出账");
        public String code;
        public String desc;

        DirectionCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(DirectionCode.values())
                    .collect(Collectors.toMap(DirectionCode::getCode, DirectionCode::getDesc))
                    .entrySet()
                    .stream()
                    .map(obj -> {
                        HashMap<String, Object> hashMap = new HashMap(2);
                        hashMap.put("code", obj.getKey());
                        hashMap.put("desc", obj.getValue());
                        return hashMap;
                    })
                    .collect(Collectors.toList());
        }


        public static String getDescByCode(String code) {
            for (DirectionCode entity : DirectionCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }
    }

    enum TradeTypeCode {
        WEBOX_ALL("WEBOX_ALL", "全部", 1),
        WEBOX_REDPACKET("WEBOX_REDPACKET", "红包", 2),
        WEBOX_RECHARGE("WEBOX_RECHARGE", "充值", 3),
        WEBOX_TRANSFER_REFUND("WEBOX_TRANSFER_REFUND", "转账退款", 6),
        WEBOX_WITHHOLDING("WEBOX_WITHHOLDING", "提现", 4),
        WEBOX_TRANSFER("WEBOX_TRANSFER", "转账", 5),
        //        WEBOX_MERCHANT_RECHARGE("WEBOX_MERCHANT_RECHARGE", "企业付款", 1),
//        WEBOX_APP_PAY("WEBOX_APP_PAY", "支付"),
//        WEBOX_APP_PAY_REFUND("WEBOX_APP_PAY_REFUND", "支付退款"),
//        SPLIT_PAYMENT("SPLIT_PAYMENT", "分账", 1),
//        SPLIT_REFUND_PAYMENT("SPLIT_REFUND_PAYMENT", "分账退款", 1)
        ;

        public String code;
        public String desc;
        public Integer order;

        TradeTypeCode(String code, String desc, Integer order) {
            this.code = code;
            this.desc = desc;
            this.order = order;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getOrder() {
            return order;
        }

        public void setOrder(Integer order) {
            this.order = order;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(TradeTypeCode.values())
                    .collect(Collectors.toMap(TradeTypeCode::getOrder, Function.identity()))
                    .entrySet()
                    .stream()
                    .sorted(Comparator.comparingInt(Map.Entry::getKey))
                    .map(x -> {
                        Map<String, Object> map = new HashMap<>();
                        map.put("code", x.getValue().getCode());
                        map.put("desc", x.getValue().getDesc());
                        return map;
                    }).collect(Collectors.toList());
        }

        public static String getDescByCode(String code) {
            for (TradeTypeCode entity : TradeTypeCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }

    }

    enum RedPacketTypeCode {
        WEBOX_REDPACKET("WEBOX_REDPACKET", "红包"),
//        WEBOX_REDPACKET_ONE_TO_ONE("WEBOX_REDPACKET_ONE_TO_ONE", "一对一红包"),
//        WEBOX_REDPACKET_GROUP_NORMAL("WEBOX_REDPACKET_GROUP_NORMAL", "普通群红包"),
//        WEBOX_REDPACKET_GROUP_LUCK("WEBOX_REDPACKET_GROUP_LUCK", "拼手气红包"),
//        WEBOX_REDPACKET_REFUND("WEBOX_REDPACKET_REFUND", "红包退款")
        ;

        public String code;
        public String desc;

        RedPacketTypeCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static List<Map<String, Object>> getAll() {
            return Arrays
                    .stream(RedPacketTypeCode.values())
                    .collect(Collectors.toMap(RedPacketTypeCode::getCode, RedPacketTypeCode::getDesc))
                    .entrySet()
                    .stream()
                    .map(obj -> {
                        HashMap<String, Object> hashMap = new HashMap(2);
                        hashMap.put("code", obj.getKey());
                        hashMap.put("desc", obj.getValue());
                        return hashMap;
                    })
                    .collect(Collectors.toList());
        }

        public static String getDescByCode(String code) {
            for (RedPacketTypeCode entity : RedPacketTypeCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }
    }

    enum OrderStatusCode {
        SUCCESS("SUCCESS", "成功"),
        SEND("SEND", "已发送"),
        TIMEOUT("TIMEOUT", "超时退款"),
        REJECT("REJECT", "拒收"),
        ;
        public String code;
        public String desc;

        OrderStatusCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code) {
            for (OrderStatusCode entity : OrderStatusCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }

    }

    enum PaymentTypeCode {
        BALANCE("BALANCE", "余额支付"),
        BANK_CARD("BANK_CARD", "银行卡支付"),
        ;
        public String code;
        public String desc;

        PaymentTypeCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code) {
            for (PaymentTypeCode entity : PaymentTypeCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }

    }

    enum RefundTypeCode {
        BALANCE("BALANCE", "余额退回"),
        BANKCARD("BANKCARD", "银行卡退回"),
        ;
        public String code;
        public String desc;

        RefundTypeCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code) {
            for (RefundTypeCode entity : RefundTypeCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }

    }


    enum ReplaceTradeTypeCode {
        WEBOX_REDPACKET("WEBOX_REDPACKET", "红包"),
        WEBOX_RECHARGE("WEBOX_RECHARGE", "充值"),
        WEBOX_TRANSFER("WEBOX_TRANSFER", "转账"),
        WEBOX_TRANSFER_REFUND("WEBOX_TRANSFER_REFUND", "转账退款"),
        WEBOX_WITHHOLDING("WEBOX_WITHHOLDING", "提现"),
        WEBOX_ONE_TO_ONE("WEBOX_ONE_TO_ONE", "红包"),
        WEBOX_GROUP_NORMAL("WEBOX_GROUP_NORMAL", "红包"),
        WEBOX_GROUP_LUCK("WEBOX_GROUP_LUCK", "红包"),
        WEBOX_REDPACKET_REFUND("WEBOX_REDPACKET_REFUND", "红包"),
        WEBOX_MERCHANT_RECHARGE("WEBOX_MERCHANT_RECHARGE", "企业付款"),
        WEBOX_APP_PAY("WEBOX_APP_PAY", "支付"),
        WEBOX_APP_PAY_REFUND("WEBOX_APP_PAY_REFUND", "支付退款"),
        SPLIT_PAYMENT("SPLIT_PAYMENT", "分账"),
        SPLIT_REFUND_PAYMENT("SPLIT_REFUND_PAYMENT", "分账退款"),
        WEBOX_REDPACKET_GROUP_NORMAL("WEBOX_REDPACKET_GROUP_NORMAL", "红包"),
        WEBOX_REDPACKET_ONE_TO_ONE("WEBOX_REDPACKET_ONE_TO_ONE", "红包"),
        WEBOX_REDPACKET_GROUP_LUCK("WEBOX_REDPACKET_GROUP_LUCK", "红包"),
        ;

        public String code;
        public String desc;

        ReplaceTradeTypeCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }


        public static String getDescByCode(String code) {
            for (ReplaceTradeTypeCode entity : ReplaceTradeTypeCode.values()) {
                if (code.equals(entity.getCode())) {
                    return entity.getDesc();
                }
            }
            return "";
        }

    }

    enum AccountFlowType {
        ALL("0", "全部", "2,3,4,11,7,8,9,10,13,14,15,16,17,18,19,20"),
        RED_PACKAGE("1", "红包", "8,9,10"),
        RECHARGE("2", "充值", "7"),
        WITHDRAW("3", "提现", "2,3,4,11"),
        TRANSFER("4", "转账", "13,14,15");

        public String code;
        public String desc;
        public String value;


        AccountFlowType(String code, String desc, String value) {
            this.code = code;
            this.desc = desc;
            this.value = value;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }


        public static List<Map<String, Object>> getAll() {
            return Arrays.stream(AccountFlowType.values()).map(x -> {
                Map<String, Object> map = new HashMap<>();
                map.put("code", x.getCode());
                map.put("desc", x.getDesc());
                return map;
            }).collect(Collectors.toList());
        }

        public static String getValue(String type) {
            AccountFlowType[] values = AccountFlowType.values();
            for (AccountFlowType item : values) {
                if (item.getCode().equals(type)) {
                    return item.getValue();
                }
            }
            return ALL.getValue();
        }
    }
}
